home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
language
/
embedded
/
mcu
/
dtmf.arc
/
DTMF11.LST
< prev
next >
Wrap
File List
|
1989-12-17
|
15KB
|
254 lines
M68HC11 Portable Cross Assembler 0.05 MS-DOS/PC-DOS Page 1
Sun Dec 17 12:23:27 1989
Command line:
C:\MOT\DTMF\..\pasms\PASMHC11.EXE -l dtmf11.lst dtmf11.asm
Options list:
ON - b - Printing of macro definitions
ON - c - Printing of macro calls
OFF - d - Placing of symbolic debugging information in COFF
OFF - e - Printing of macro expansions
ON - f - Printing of conditional directives
OFF - g - Printing of generated constants list
OFF - q - Expanding and printing of structured syntax
OFF - s - Printing of symbol table
OFF - u - Printing of conditional unassembled source
OFF - x - Printing of cross reference table
OFF - m - Suppress printing of error messages
ON - w - Printing of warning messages
OFF - v - Suppress printing of updated status
OFF - y - Enabling of sgs extensions
ON - o - Create object code
ON - - Formatting of source line listing
Create listing file - l - dtmf11.lst
Xdefs:
NONE
Xrefs:
NONE
Input file(s): dtmf11.asm (151 lines)
sine56.asm (32 lines)
Output file: dtmf11.o
Listing file: dtmf11.lst
M68HC11 Portable Cross Assembler 0.05 dtmf11.asm Page 2
Sun Dec 17 12:23:27 1989
Options - MD,MC,NOG,NOU,W,NOMEX,CL,FMT,O
LINE S PC OPCO OPERANDS S LABEL MNEMO OPERANDS COMMENT
00001 * File: DTMF11.ASM
00002 * Driver routines for 68HC11 to produce DTMF tones in software
00003
00004 * this version uses a fixed 256 byte sine table, and a fixed 128 us sample time
00005 * this allows operation under interrupt control
00006
00007 * hardware requirements: 8 bit DAC on port b of 68HC11
00008 * To use, do a JSR to DTINIT to set up timer
00009 * then do a JSR to location DTMF with the digit in the lower nibble of
00010 * Accumulator A
00011 * digit values: 0-9, 10 = #, 11 = *, 12-15 represent a through d
00012 * A 60 ms tone burst will be generated, followed by 60 ms of silence
00013 * The location TTIME may be altered to change this timing
00014
00015 asct
00016
00017 * First a few definitions
00018
00019 A 0000 1000 A io equ $1000 offset for i/o registers
00020 A 0000 003c A deftt equ 60 default tone time (60 ms)
00021 A 0000 1004 A dac equ io+4 DAC output on port a
00022 A 0000 100e A tcnt equ io+$e timer free running counter
00023 A 0000 1016 A ocr1 equ io+$16 output compare register
00024 A 0000 1022 A tmsk1 equ io+$22 int mask register
00025 A 0000 1023 A tflg1 equ io+$23 int flag register
00026 A 0000 0080 A ocie equ $80 output compare interrupt enable
00027 A 0000 0100 A intcnt equ 128*2 count to load into output compare
00028
00029 A 0000 0017 A row1 equ 23 row intervals
00030 A 0000 0019 A row2 equ 25
00031 A 0000 001c A row3 equ 28
00032 A 0000 001f A row4 equ 31
00033
00034 A 0000 0028 A col1 equ 40 column intervals
00035 A 0000 002c A col2 equ 44
00036 A 0000 0030 A col3 equ 48
00037 A 0000 0036 A col4 equ 54
00038
00039 A 0000 org $0 RAM scratchpad - move this to fit your system
00040 A 0000 01 A ttime rmb 1 tone time in milliseconds
00041 A 0001 02 A ttctr rmb 2 time counter
00042 A 0003 02 A ttsave rmb 2 save the count value for interdigit pause
00043 A 0005 01 A ttflag rmb 1 non zero means generate tones
00044 A 0006 02 A rowptr rmb 2 next row sample to load
00045 A 0008 02 A colptr rmb 2 ditto for columns
00046 A 000a 01 A rowint rmb 1 row interval - added to row counter each sample
00047 A 000b 01 A colint rmb 1 ditto for column
00048 A 000c 01 A sample rmb 1 temp storage for sample
00049
00050 * sine is the 256 byte sine wave table
00051 * this must be located on a page boundary! (ie lower 8 bits of address = 0)
00052
M68HC11 Portable Cross Assembler 0.05 dtmf11.asm Page 3
Sun Dec 17 12:23:27 1989
Options - MD,MC,NOG,NOU,W,NOMEX,CL,FMT,O
LINE S PC OPCO OPERANDS S LABEL MNEMO OPERANDS COMMENT
00053 A 1000 org $1000
00054
00055 include sine56.asm
00001 A 1000 0001030405A sine fcb 0,1,3,4,5,7,8,10
00002 A 1008 0b0c0e0f10A fcb 11,12,14,15,16,18,19,20
00003 A 1010 151718191aA fcb 21,23,24,25,26,28,29,30
00004 A 1018 1f20212224A fcb 31,32,33,34,36,37,38,39
00005 A 1020 2829292a2bA fcb 40,41,41,42,43,44,45,46
00006 A 1028 2f2f303131A fcb 47,47,48,49,49,50,51,51
00007 A 1030 3434353536A fcb 52,52,53,53,54,54,54,55
00008 A 1038 3737373838A fcb 55,55,55,56,56,56,56,56
00009 A 1040 3838383838A fcb 56,56,56,56,56,56,55,55
00010 A 1048 3737363636A fcb 55,55,54,54,54,53,53,52
00011 A 1050 3433333231A fcb 52,51,51,50,49,49,48,47
00012 A 1058 2f2e2d2c2bA fcb 47,46,45,44,43,42,41,41
00013 A 1060 2827262524A fcb 40,39,38,37,36,34,33,32
00014 A 1068 1f1e1d1c1aA fcb 31,30,29,28,26,25,24,23
00015 A 1070 1514131210A fcb 21,20,19,18,16,15,14,12
00016 A 1078 0b0a080705A fcb 11,10,8,7,5,4,3,1
00017 A 1080 00fffdfcfbA fcb 0,-1,-3,-4,-5,-7,-8,-10
00018 A 1088 f5f4f2f1f0A fcb -11,-12,-14,-15,-16,-18,-19,-20
00019 A 1090 ebe9e8e7e6A fcb -21,-23,-24,-25,-26,-28,-29,-30
00020 A 1098 e1e0dfdedcA fcb -31,-32,-33,-34,-36,-37,-38,-39
00021 A 10a0 d8d7d7d6d5A fcb -40,-41,-41,-42,-43,-44,-45,-46
00022 A 10a8 d1d1d0cfcfA fcb -47,-47,-48,-49,-49,-50,-51,-51
00023 A 10b0 cccccbcbcaA fcb -52,-52,-53,-53,-54,-54,-54,-55
00024 A 10b8 c9c9c9c8c8A fcb -55,-55,-55,-56,-56,-56,-56,-56
00025 A 10c0 c8c8c8c8c8A fcb -56,-56,-56,-56,-56,-56,-55,-55
00026 A 10c8 c9c9cacacaA fcb -55,-55,-54,-54,-54,-53,-53,-52
00027 A 10d0 cccdcdcecfA fcb -52,-51,-51,-50,-49,-49,-48,-47
00028 A 10d8 d1d2d3d4d5A fcb -47,-46,-45,-44,-43,-42,-41,-41
00029 A 10e0 d8d9dadbdcA fcb -40,-39,-38,-37,-36,-34,-33,-32
00030 A 10e8 e1e2e3e4e6A fcb -31,-30,-29,-28,-26,-25,-24,-23
00031 A 10f0 ebecedeef0A fcb -21,-20,-19,-18,-16,-15,-14,-12
00032 A 10f8 f5f6f8f9fbA fcb -11,-10,-8,-7,-5,-4,-3,-1
00056
00057 A 1100 86 3c A dtinit ldaa #deftt set up time counter
00058 A 1102 97 00 A staa ttime
00059 A 1104 86 80 A ldaa #$80 set dac to halfway point
00060 A 1106 b7 1004 A staa dac
00061 A 1109 7f 0005 A clr ttflag no tones please
00062 A 110c 0f sei set up timer - first disable interrupts
00063 A 110d fc 100e A ldd tcnt freeze counter
00064 A 1110 c3 0100 A addd #intcnt
00065 A 1113 fd 1016 A std ocr1
00066 A 1116 86 80 A ldaa #ocie
00067 A 1118 b7 1022 A staa tmsk1
00068 A 111b b7 1023 A staa tflg1 clear flag if set
00069 A 111e 0e cli
00070 A 111f 39 rts done for now
00071
00072 A 1120 84 0f A dtmf anda #$0f clear out junk
M68HC11 Portable Cross Assembler 0.05 dtmf11.asm Page 4
Sun Dec 17 12:23:27 1989
Options - MD,MC,NOG,NOU,W,NOMEX,CL,FMT,O
LINE S PC OPCO OPERANDS S LABEL MNEMO OPERANDS COMMENT
00073 A 1122 16 tab get row interval
00074 A 1123 ce 11ac A ldx #rowtab
00075 A 1126 3a abx
00076 A 1127 a6 00 A ldaa ,x
00077 A 1129 97 0a A staa rowint
00078 A 112b a6 10 A ldaa rowtab-coltab,x and column
00079 A 112d 97 0b A staa colint
00080 A 112f cc 1000 A ldd #sine
00081 A 1132 dd 06 A std rowptr start at 0
00082 A 1134 dd 08 A std colptr
00083 A 1136 96 00 A ldaa ttime start tone - set time
00084 A 1138 c6 fa A ldab #250 adjust for # of samples in (ttime) msec
00085 A 113a 3d mul (125/128) * ttime * 4
00086 A 113b 04 lsrd
00087 A 113c 04 lsrd
00088 A 113d 04 lsrd
00089 A 113e 04 lsrd
00090 A 113f 04 lsrd
00091 A 1140 04 lsrd
00092 A 1141 dd 03 A std ttsave save for pause time
00093 A 1143 dd 01 A std ttctr
00094 A 1145 7c 0005 A inc ttflag start tones
00095 A 1148 12 0501fc 1148 dtmf1 brset ttflag,#1,dtmf1 loop till tone complete
00096 A 114c dc 03 A ldd ttsave now do pause
00097 A 114e dd 01 A std ttctr
00098 A 1150 7f 000a A clr rowint do the pause by not moving pointers
00099 A 1153 7f 000b A clr colint
00100 A 1156 7c 0005 A inc ttflag start pause
00101 A 1159 12 0500fc 1159 dtmf2 brset ttflag,#0,dtmf2
00102 A 115d 39 rts done
00103
00104 * timer interrupt service routine
00105 * if ttctr != 0, then output next sample to dac
00106
00107 A 115e fc 1016 A tisr ldd ocr1 (5) add timer count
00108 A 1161 c3 0100 A addd #intcnt (4)
00109 A 1164 fd 1016 A std ocr1 (5)
00110 A 1167 86 80 A ldaa #ocie (2) clear flag
00111 A 1169 b7 1022 A staa tmsk1 (4)
00112 A 116c 13 05012b 119b brclr ttflag,#1,tisr1 (6) don't generate tone if flag cleared
00113 A 1170 de 06 A ldx rowptr (4) get next row sample
00114 A 1172 18de 08 A ldy colptr (5)
00115 A 1175 18a6 00 A ldaa ,y (5) get column sample
00116 A 1178 47 asra (2) divide by 4
00117 A 1179 47 asra (2) divide by 4
00118 A 117a 18ab 00 A adda ,y (5) now have 1.25 * column sample
00119 A 117d ab 00 A adda ,x (4) add in row sample
00120 A 117f 88 80 A eora #$80 (2) fix sign bit
00121 A 1181 b7 1004 A staa dac (4)
00122 A 1184 8f xgdx (3) step to next lookup value - first row ...
00123 A 1185 db 0a A addb rowint (3)
00124 A 1187 dd 06 A std rowptr (4)
M68HC11 Portable Cross Assembler 0.05 dtmf11.asm Page 5
Sun Dec 17 12:23:27 1989
Options - MD,MC,NOG,NOU,W,NOMEX,CL,FMT,O
LINE S PC OPCO OPERANDS S LABEL MNEMO OPERANDS COMMENT
00125 A 1189 188f xgdy (4) ... then column ...
00126 A 118b db 0b A addb colint (3)
00127 A 118d dd 08 A std colptr (4)
00128 A 118f dc 01 A ldd ttctr (4) decrement timer
00129 A 1191 83 0001 A subd #1 (4)
00130 A 1194 dd 01 A std ttctr (4)
00131 A 1196 26 03 119b bne tisr1 (3) did count go to zero ?
00132 A 1198 7f 0005 A clr ttflag ( ) yes - turn off tones
00133 A 119b 3b tisr1 rti (12)
00134 * (12) interrupt response
00135 * ===
00136 * 119 cycles when generating tones
00137 * total overhead at 2 MHz E clock = 119/256 == 46%
00138
00139 A 119c 2c282c30 A coltab fcb col2,col1,col2,col3 0,1,2,3
00140 A 11a0 282c30 A fcb col1,col2,col3 4,5,6
00141 A 11a3 282c30 A fcb col1,col2,col3 7,8,9
00142 A 11a6 2830 A fcb col1,col3 #,*
00143 A 11a8 36363636 A fcb col4,col4,col4,col4 a,b,c,d
00144
00145 A 11ac 1f171717 A rowtab fcb row4,row1,row1,row1 0,1,2,3
00146 A 11b0 191919 A fcb row2,row2,row2 4,5,6
00147 A 11b3 1c1c1c A fcb row3,row3,row3 7,8,9
00148 A 11b6 1f1f A fcb row4,row4 #,*
00149 A 11b8 17191c1f A fcb row1,row2,row3,row4 a,b,c,d
00150
00151 end
Total number of errors: 0
Total number of warnings: 0
Total number of lines: 183
Number of bytes in section ASCT: 457
Number of bytes in program: 457